import { ref } from 'vue'
import { defineStore } from 'pinia'
import { ElMessage } from 'element-plus'

export const useUserStore = defineStore(
    'user',
    () => {

        const user = ref({
            name: 'admin',
            token: '1234567890'
        })
        
        const sendMessage = (message: string) => {
            ElMessage({
                message,
                type: 'success',
            })
        }

        return {
            user,
            sendMessage
        }
    }, {
    persist: true
})